package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Setter
@Getter
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class TravelComment extends BaseDomain {
    private User user;
    private String comment;
    private Travel travel;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss", timezone = "GMT+8")
    private Date createTime;
    private String coverUrl;
    private Integer state;

    private boolean isRead;//是否查看了评论

    /*public Object getJson(){

        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("userId",user.getId());
        map.put("userName",user.getNickName());
        map.put("comment",comment);
        map.put("createTime",createTime);
        map.put("coverUrl",coverUrl);
        map.put("state",state);

        return JSON.toJSONString(map);
    }*/
}
